// swap.c 
// gcc swap.c

#include <stdio.h>
#include <stdlib.h>

void swap(int *a, int *b)  // local variable
{
    int tmp;
    
    tmp = *a;
    *a = *b;
    *b = tmp;
}

int main()
{
    int x = 10, y = 20;
    
    printf("x = %d , y = %d\n", x, y);
    swap(&x, &y);
    printf("x = %d , y = %d\n", x, y);
    printf("\n");
    system("pause");
    return 0;
}

